package com.lc.type.impl;

import com.lc.type.TypeHandler;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class StringTypeHandler implements TypeHandler<String> {

    @Override
    public String getColumnValue(ResultSet rs, String columnName) throws SQLException {
        if (rs != null) {
            return rs.getString(columnName);
        }
        return null;
    }

    @Override
    public void setStatementValue(PreparedStatement ps, int paramIndex, String paramValue) throws SQLException {
        ps.setString(paramIndex, paramValue);
    }


}
